﻿@{
    ViewBag.PageTitle = Resources.Intercamber.Login_PageName;
}

@section PageContent {
    <style type="text/css">
        .loginDiv
        {
            text-align: center;
            padding: 30px; /*10px 35px 5px 35px;*/
            width: 300px;
            border: 1px solid gray;
            background-color: white;
        }
        .title1
        {
            font-size: 22px;
            font-weight: 700;
        }
        .btnConnect {
            cursor: pointer;
            height: 35px;
            width: 91px;
            padding: 0;
            border: 0;
            background-image: url("/Images/Login/ButtonLogin.png");
            background-position: 0 0;
        }
        .btnConnect:hover {
            background-position: 0 -40px;
        }
        .btnConnect:active {
            background-position: 0 -80px;
        }
    </style>
    <script type="text/javascript">
        disableAutoWidth = true;
        $(function() {
            document.onkeypress = function(e) {
                var key = window.event ? window.event.keyCode : e.which;
                if (key == 13) {
                    $("#ConnectButton").click();
                    return false;
                }
                return true;
            };
            $("#login").focus();
        });

        function CryptPassword() {
            $("#Password").val(Sha256($('#PasswordInput').val()));
        }
    </script>

    @using (Html.BeginForm())
    {
//        @Html.AntiForgeryToken()
        <div align="center" style="width: 100%; margin-top: 150px">
            <table style="" width="300px" @*class="ui-corner-all loginDiv"*@ >
                <tr>
                    <td valign="middle" align="center">
                        <input type="text" id="login" name="Email" class="loginInput" style="width: 200px;" value="@ViewBag.Email" aria-label="@Resources.Intercamber.Login_Email" placeholder="@Resources.Intercamber.Login_Email" />
                    </td>
                </tr>
                <tr>
                    <td valign="middle" align="center">
                        <input id="PasswordInput" type="password" class="loginInput" style="width: 200px;"  aria-label="@Resources.Intercamber.Password" placeholder="@Resources.Intercamber.Password" />
                        <input id="Password" name="Password" type="hidden" runat="server" />
                        <br/>
                        <a href="~/Account/ForgottenPassword" class="smallLink" style="color: white" runat="server">@Resources.Intercamber.Login_ForgottenPassword</a>
                    </td>
                </tr>
                <tr>
                    <td valign="middle" align="center" style="padding: 10px">
                        <div id="ConnectButton" class="btnConnect" onclick=" CryptPassword(); document.forms[0].submit();" title="@Resources.Intercamber.Connection" >&nbsp;</div>
                        @*<button id="ConnectButton" class="btnConnect" onclick="CryptPassword();"></button>*@
                    </td>
                </tr>
                <tr>
                    <td align="center"> 
                        <label id="errorMessage" style="color: red">@Html.Raw(ViewBag.ErrorMessage)</label>
                    </td>
                </tr>
            </table>
        </div>
    }
}

